package com.leyou.item.service;

import com.leyou.item.pojo.Brand;
import com.leyou.common.parameter.BrandQueryByPageParameter;
import com.leyou.common.pojo.PageResult;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface BrandService {
    /**
     * 分页查询
     * @param param
     * @return
     */
    //public PageResult<Brand> queryBrandByPageAndSort(Integer page, Integer rows, String sortBy, Boolean desc, String key);
    public PageResult<Brand>  queryBrandByPageAndSort(BrandQueryByPageParameter param);

    /**
     * 新增品牌
     * @param brand
     * @param cids
     */
    void saveBrand(Brand brand, List<Long> cids);

    /**
     * 更新品牌
     * @param brand
     * @param categories
     */
    void updateBrand(Brand brand, List<Long> categories);

    @Transactional(rollbackFor = Exception.class)
     void deleteBrand(Long bid);

    /**
     * 删除品牌
     * @param bid
     */
    void deleteByBrandIdInCategoryBrand(Long bid);

    /**
     * 根据category id查询brand
     * @param cid
     * @return
     */
    List<Brand> queryBrandByCategoryId(Long cid);

    /**
     * 根据品牌id集合查询品牌信息
     * @param ids
     * @return
     */
    List<Brand> queryBrandByBrandIds(List<Long> ids);


}
